---
title: trim
description: Trim values from a string
group: String
---

## Basic usage

Trims all prefix and suffix characters from the given string. Like the builtin trim function but accepts alternate (other than space) characters you would like to trim.

```ts
import { trim } from 'radash'

trim('  hello ') // => hello
trim('__hello__', '_') // => hello
trim('/repos/:owner/', '/') // => repos/:owner
```

Trim also handles more than one character to trim.

```ts
trim('222__hello__111', '12_') // => hello
```
